<?php

class SendNote{

public function send($setSmsFreeSignName,$tel,$code,$content){
    include "TopSdk.php";
    $ci = & get_instance();
    $c = new TopClient;
    $ci->db->where('id',3);
    $noteconfig=$ci->db->get('wx_pay')->result_array();
    $c ->appkey = $noteconfig['0']['APPID'] ;
    $c ->secretKey = $noteconfig['0']['APPSECRET'] ;
    //print_r($c ->secretKey);die;
    $req = new AlibabaAliqinFcSmsNumSendRequest;
    $req ->setExtend( "" );
    $req ->setSmsType( "normal" );
    $req ->setSmsFreeSignName( "$setSmsFreeSignName" );
    $req ->setSmsParam( "{code:'$code',product:'$content'}" );
    $req ->setRecNum( "$tel" );
    $req ->setSmsTemplateCode( "SMS_131310034" );
    $resp = $c ->execute( $req );

    $resp=json_decode(json_encode($resp));
    print_r($resp);die;
    $array = json_decode(json_encode($resp),TRUE);
   if(!empty($array['result'])){
       return 'ok';
   }else{
       return print_r($resp);
   };
}
}

